/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.enrstu.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
* @website https://eladmin.vip
* @description /
* @author yyx
* @date 2024-11-04
**/
@Entity
@Data
@Table(name="param_enrollment_parameter")
public class EnrollmentParameter implements Serializable {

    @Id
    @Column(name = "`id`")
    @ApiModelProperty(value = "主键，自增")
    private String id;

    @Column(name = "`type_label`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "参数类型标签，用于分类管理统计")
    private String typeLabel;

    @Column(name = "`type_code`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "参数类型代码，用于唯一标识参数类型")
    private String typeCode;

    @Column(name = "`type_name`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "参数类型名称，用于显示参数类型的名称")
    private String typeName;

    @Column(name = "`type_description`")
    @ApiModelProperty(value = "描述，用于详细描述参数类型的具体内容")
    private String typeDescription;

    public void copy(EnrollmentParameter source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
